<template>
    <div>
        <mark>1.getter是对state的计算属性</mark>
        <h1>一共有{{listSumLen}}个</h1>
        <h2>{{age}}岁</h2>
        <h3>{{getList.reduce((a,b)=>{return a+b.n},0)}}</h3>
    </div>
</template>

<script>
import {mapGetters} from 'vuex';
export default {
    name:"Index",
    computed:{
        ...mapGetters(['listSumLen','age','getList']),
        
    },
}
</script>

<style>

</style>